package org.example;

public class CloseableTest {

    public static class AutoCloseableResource implements AutoCloseable {

        @Override
        public void close() throws Exception {
            throw new Exception("资源无法关闭");
        }
    }

    public static void main(String[] args) {
        try (AutoCloseable autoCloseable = new AutoCloseableResource();){

        } catch (Exception e) {// java.lang.Exception: 资源无法关闭
            throw new RuntimeException(e);
        }

    }
}